//
//  KLBookTranslator.m
//  KLBookStore
//
//  Created by apple on 2017/10/15.
//  Copyright © 2017年 NetEaseExam. All rights reserved.
//

#import "KLBookTranslator.h"

@implementation KLBookTranslator

- (instancetype)initWithDictionary:(NSDictionary *)dict {
    KLBookTranslator *translator = [[[self class] alloc] init];
    translator.bookId = [[dict objectForKey:@"bookId"] longLongValue];
    translator.name = [dict objectForKey:@"name"];
    return translator;
}

- (instancetype)initWithFMResultSet:(FMResultSet *)resultSet {
    KLBookTranslator *translator = [[[self class] alloc] init];
    
    translator.bookId = [resultSet longLongIntForColumn:@"bookId"];
    translator.name = [resultSet stringForColumn:@"name"];
    
    return translator;
}

- (id)copyWithZone:(NSZone *)zone {
    KLBookTranslator *translator = [[[self class] allocWithZone:zone] init];
    translator.bookId = self.bookId;
    translator.name = [self.name copy];
    
    return translator;
}

@end
